ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -> highest priority.
  
  # Sample of regular route:
  # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # You can have the root of your site routed by hooking up '' 
  # -- just remember to delete public/index.html.
  # map.connect '', :controller => "welcome"

  # Allow downloading Web Service WSDL as a file with an extension
  # instead of a file named 'wsdl'
  map.connect ':controller/service.wsdl', :action => 'wsdl'
  
  
  map.connect '', :controller => 'site', :action => 'site_home'
  
  map.connect 'newsite', :controller => 'site', :action => 'site_new'
  map.connect 'createsite', :controller => 'site', :action => 'site_create'
  map.connect 'search', :controller => 'site', :action => 'site_search'
  map.connect 'styles', :controller => 'style', :action => 'style_list'
  
  map.connect 'account/:action', :controller => 'account'
  
  
  map.connect ':site_directory', :controller => 'site', :action => 'site_show'
  map.connect ':site_directory/images', :controller => 'site', :action => 'images'
  map.connect ':site_directory/newpage', :controller => 'page', :action => 'page_new'
  map.connect ':site_directory/createpage', :controller => 'page', :action => 'page_create'
  map.connect ':site_directory/destroy', :controller => 'site', :action => 'site_destroy'
  
  map.connect ':site_directory/edit/properties', :controller => 'site', :action => 'properties_edit'
  map.connect ':site_directory/update/properties', :controller => 'site', :action => 'properties_update'
  
  map.connect ':site_directory/edit/resources', :controller => 'resource', :action => 'resources_edit'
  map.connect ':site_directory/upload/resource', :controller => 'resource', :action => 'resource_upload'
  map.connect ':site_directory/delete/resources', :controller => 'resource', :action => 'resources_delete'
  
  map.connect ':site_directory/select/style', :controller => 'style', :action => 'style_select'
  map.connect ':site_directory/update/style', :controller => 'style', :action => 'style_update'
  
  map.connect ':site_directory/edit/users', :controller => 'user', :action => 'users_edit'
  map.connect ':site_directory/update/users', :controller => 'user', :action => 'users_update'
  map.connect ':site_directory/add/users', :controller => 'user', :action => 'users_add'
  
  map.connect ':site_directory/:page_title', :controller => 'site', :action => 'site_show'
  map.connect ':site_directory/:page_title/edit', :controller => 'page', :action => 'page_edit'
  map.connect ':site_directory/:page_title/update', :controller => 'page', :action => 'page_update'
  map.connect ':site_directory/:page_title/destroy', :controller => 'page', :action => 'page_destroy'

  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id'
end
